

<#
.SYNOPSIS 
Hydration Script Module

.DESCRIPTION
Hydration Environment for MDTEx Powershell Common Modules

.NOTES
Copyright Keith Garner (KeithGa@DeploymentLive.com), All rights reserved.

.LINK
http://MDTEx.CodePlex.com

#>

[CmdletBinding()]
param(
	[parameter(Position=0,Mandatory=$false)]
	[Switch] $Verbose = $false
)


if ($Verbose)
{
	# Work Arround: I could not get verbose to work within a *.psm1 file using CmdletBinding
	$VerbosePreference = "Continue"
}

# Dynamically dot-source all scripts from the manifest file. 
if ( Test-Path $PSCommandPath.tolower().replace('.psm1','.psd1') )
{
    $Manifest = Get-Content -Raw -path $PSCommandPath.tolower().replace('.psm1','.psd1') | Invoke-Expression
    foreach ( $Script in $Manifest.ModuleList )
    {
        Write-Verbose "dot source script: [$script]"
        . $PSSCriptRoot\$Script
    }
}

Export-ModuleMember -Function *

